package com.yidu.hbatsams.service.Impl;

import com.yidu.hbatsams.dao.AtsSchemeAthleteMapper;
import com.yidu.hbatsams.domain.AtsSchemeAthlete;
import com.yidu.hbatsams.service.AtsSchemeAthleteFsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.List;
@Service
public class AtsSchemeAthleteFsImpl implements AtsSchemeAthleteFsService
{
    @Resource
    private AtsSchemeAthleteMapper daoMapper;
    @Override
    public List<AtsSchemeAthlete> selectAll() {
        List<AtsSchemeAthlete> list=daoMapper.selectAll();
        return list;
    }

    @Override
    public int updateIsva(Integer schemeId) {
        return daoMapper.updateIsva(schemeId);
    }

    @Override
    public List<AtsSchemeAthlete> selectCheckAthlete(Integer schemeId) {
        return daoMapper.selectschemeId(schemeId);
    }

    @Override
    public int updateByPrimaryKeySelective(AtsSchemeAthlete record) {
        return daoMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int addAthleteExp(AtsSchemeAthlete record) {
        return daoMapper.addAthleteExp(record);
    }

    @Override
    public int lookAthlete(AtsSchemeAthlete record) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        record.setReadTime(simpleDateFormat.format(new java.sql.Date(System.currentTimeMillis())));
        record.setIsRead("已查看");
        return daoMapper.lookAthlete(record);
    }

    @Override
    public AtsSchemeAthlete selectExp(AtsSchemeAthlete record) {
        return daoMapper.selectExp(record);
    }
}
